package com.meatball.dji.common.mqtt.handler.request.data.dto

import com.alibaba.fastjson2.annotation.JSONField

/**
 * TODO 设备绑定到组织请求参数
 *
 * @see com.meatball.dji.common.mqtt.data.model.ConfigModel
 *
 * @author 张翔宇
 * @since 2024年4月23日
 */
data class OrganizationBindParams(
    val tid: String,
    val bid: String,
    val timestamp: Long = System.currentTimeMillis(),
    val gateway: String,
    val method: String,
    val data: Data
) {
    /**
     * TODO 数据类
     *
     * @property bindDevices 绑定参数列表
     *      {"size": "2"}
     */
    data class Data(
        @field:JSONField(name = "bind_devices")
        val bindDevices: List<BindDevice>
    ) {
        /**
         * TODO 设备绑定到组织请求参数
         *
         * @property deviceBindingCode 设备绑定码
         * @property organizationId 组织id
         * @property deviceCallSign 设备在组织的名称
         * @property sn 设备序列号
         * @property deviceModelKey 产品枚举值
         *      @see https://developer.dji.com/doc/cloud-api-tutorial/cn/overview/product-support.html
         */
        data class BindDevice(
            @field:JSONField(name = "device_binding_code")
            val deviceBindingCode: String,
            @field:JSONField(name = "organization_id")
            val organizationId: String,
            @field:JSONField(name = "device_callsign")
            val deviceCallSign: String,
            val sn: String,
            @field:JSONField(name = "device_model_key")
            val deviceModelKey: String
        )
    }
}
